

package com.hazelcast.internal.config;

import com.hazelcast.config.FlakeIdGeneratorConfig;

/**
 * See {@link FlakeIdGeneratorConfig}
 */
public class FlakeIdGeneratorConfigReadOnly extends FlakeIdGeneratorConfig {

    public FlakeIdGeneratorConfigReadOnly(FlakeIdGeneratorConfig config) {
        super(config);
    }

    @Override
    public FlakeIdGeneratorConfig setName(String name) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setPrefetchCount(int prefetchCount) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setPrefetchValidityMillis(long prefetchValidityMs) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setEpochStart(long epochStart) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setNodeIdOffset(long nodeIdOffset) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setBitsSequence(int bitsSequence) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setBitsNodeId(int bitsNodeId) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setAllowedFutureMillis(long allowedFutureMillis) {
        throw throwReadOnly();
    }

    @Override
    public FlakeIdGeneratorConfig setStatisticsEnabled(boolean statisticsEnabled) {
        throw throwReadOnly();
    }

    private UnsupportedOperationException throwReadOnly() {
        throw new UnsupportedOperationException("This config is read-only");
    }
}
